/*根据ddl 生成 service  mapper controller  plus版本 */

const {
    firstworldupp,
    toHump,
    firstworlddown,
    toLine
} = require("./utils");


const {Parser} = require('sql-ddl-to-json-schema');
const lodash = require('lodash')

function createEntity(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = ""
        if (key == 'id') {

            str = `
        /**
        *@description  ${define.description || ""}
        */
        @TableId(value="id",type = IdType.AUTO)
        private ${firstworldupp(define.type)} id;\n`

        } else if (key.indexOf("time") >= 0) {
            //如果是时间格式
            str = `
        /**
        *@description  ${define.description || ''}
        */
        @TableField("${key}")\n
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")\n
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//返回前端字段转换\n
        private Date ${toHump(key)};\n`
            colStr += str
        } else {
            str = `
        /**
        *@description  ${define.description || ""}
        */
        @TableField("${key}")\n
        private ${firstworldupp(define.type)} ${toHump(key)};\n`
        }
        colStr += str

    })
    const entity = `
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;


@TableName("${tableName}")
@Data
public class ${tableNameBig} implements Serializable{

    ${colStr}

}
`
    return entity;
}

function createMapper(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
        /**
        *@description  ${define.description}
        */
        private ${firstworldupp(define.type)} ${toHump(key)};\n\n`
        colStr += str

    })
    const mapperTemplate = `
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ${tableNameBig}Mapper extends BaseMapper<${tableNameBig}>{
}
`
    return mapperTemplate;
}

function createService(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
        /**
        *@description  ${define.description}
        */
        private ${firstworldupp(define.type)} ${toHump(key)};\n\n`
        colStr += str

    })
    const serviceTemplate = `import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

public interface ${tableNameBig}Service extends IService<${tableNameBig}>{

    /**
     * 查询所有
     * @return
     */
    List<${tableNameBig}> listAll(QueryWrapper queryWrapper);

\t/**
     * id条件查询
     * @return
     */
    ${tableNameBig} listOne(Long id);

    /***
     * 保存
     * @param ${tableNameSmall}
     * @return
     */
    int insert(${tableNameBig} ${tableNameSmall});

}`
    return serviceTemplate;
}

function createServiceImpl(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
        /**
        *@description  ${define.description}
        */
        private ${firstworldupp(define.type)} ${toHump(key)};\n\n`
        colStr += str

    })
    const serviceImpTemplate = `
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
import java.util.stream.Collectors;


@Service
public class ${tableNameBig}ServiceImpl extends ServiceImpl<${tableNameBig}Mapper,${tableNameBig}> implements ${tableNameBig}Service{

    @Autowired
    private ${tableNameBig}Mapper ${tableNameSmall}Mapper;

    //查询所有
    @Override
    public List<${tableNameBig}> listAll(QueryWrapper queryWrapper) {
        List<${tableNameBig}> ${tableNameSmall}s = this.list(queryWrapper);
        return ${tableNameSmall}s;
    }

    //条件查询
        @Override
    public ${tableNameBig} listOne(Long id) {
        ${tableNameBig} ${tableNameSmall} = this.getById(id);
        return ${tableNameSmall};
    }

    //保存
        @Override
    public int insert(${tableNameBig} ${tableNameSmall}){
        return ${tableNameSmall}Mapper.insert(${tableNameSmall});

    }

}
`
    return serviceImpTemplate;
}

function createController(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
        /**
        *@description  ${define.description}
        */
        private ${firstworldupp(define.type)} ${toHump(key)};\n\n`
        colStr += str

    })
    const controllerTemplate = `
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.dto.PageDto;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/${tableNameSmall}")
public class ${tableNameBig}Controller {

    @Autowired
    private ${tableNameBig}Service ${tableNameSmall}Service;


    @GetMapping("/one")
    public R one(@RequestParam(value = "id", required = true) String id) {
        if(null == id || "".equals(id)){
            return R.error().put("msg", "缺少参数id");
        }

        return R.ok().put("result", ${tableNameSmall}Service.getById(id));
    }
    
    @GetMapping("/listAll")
    public R listAll() {
        return R.ok().put("result",${tableNameSmall}Service.list(null));
    }

    @GetMapping("/page")
    @ApiImplicitParams({
            @ApiImplicitParam(name="pageSize",dataType="String"),
            @ApiImplicitParam(name="pageNum",dataType="String")
    })
    public R page(
            Integer pageSize,Integer pageNum) {
        if (null == pageSize || "".equals(pageSize)) {
            pageSize = 10;
        }
        if (null == pageNum || "".equals(pageNum)) {
            pageNum = 0;
        }
        QueryWrapper<${tableNameBig}> queryWrapper = new QueryWrapper<>();
        return R.ok().put("result",${tableNameSmall}Service.page(new Page<>(pageNum,pageSize), queryWrapper));
    }
    @PostMapping("/add")
    public R add(@RequestBody ${tableNameBig} ${tableNameSmall}) {
        return R.ok().put("result",${tableNameSmall}Service.save(${tableNameSmall}));
    }
    @PostMapping("/update")
    public R update(@RequestBody  ${tableNameBig} ${tableNameSmall}, HashMap<String, Object> updateOptions) {
        QueryWrapper<${tableNameBig}> queryWrapper=new QueryWrapper<>();
        if(null != ${tableNameSmall}.getId() && !("".equals(${tableNameSmall}.getId()))){
            queryWrapper.eq("id",${tableNameSmall}.getId());
        }else{
          return R.error("id不能为空");
        }
        return R.ok().put("result",${tableNameSmall}Service.update(${tableNameSmall},queryWrapper));
    }
    
    @GetMapping("/delete")
    public R deleteOne(@RequestParam(value = "id",required = true) String id) {
        return R.ok().put("result", ${tableNameSmall}Service.removeById(id));
    }
}
`
    return controllerTemplate;
}

function createVueList(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
             <el-table-column
            label="${toHump(define.description || key)}" prop="${toHump(key)}">
          </el-table-column>
        `
        colStr += str

    })
    const controllerTemplate = `

<template>
  <div class="app-container" style="padding: 20px;">
    <div>
      <el-button @click="()=>triggerModify()">添加</el-button>
    </div>
    <el-table
    border
      ref="multipleTable"
      :data="lists"
      tooltip-effect="dark"
      style="width: 100%"
      @selection-change="(rows)=>selectRows=rows">
      <el-table-column
        type="selection"
        width="25">
      </el-table-column>
     ${colStr}
      <el-table-column
        prop="address"
        label="操作"  width="220"
        fixed="right">
        <template slot-scope="scope">
          <el-button type="text"  @click="()=>triggerModify(scope.row)">修改</el-button>
        <el-popconfirm
                            placement="bottom"
                            width="200"
                            trigger="click"
                            title="确定删除吗?"
                            @confirm="()=>deleteOne(scope.row.id)">
                        <el-button slot="reference" type="text" style="padding-left: 10px;">删除</el-button>
                    </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      style="padding: 20px;"
      :page-size="filter.pageSize"
      layout="prev, pager, next"
      :total="filter.total"
      @size-change="(pageSize)=>{$data.filter.pageSize=pageSize;lists=[];ajaxList();}"
      @current-change="(pageNum)=>{$data.filter.pageNum=pageNum;lists=[];ajaxList();}"
    >
    </el-pagination>

    <!--弹出框-->
    <modify class="vue" ref="modifyDialog" @refresh="()=>ajaxList()"></modify>
  </div>
</template>
<script>
  import axios from '@/utils/request'

  export default {
    components: {
      modify: () => import('./modify')
    },
    data() {
      return {
        filter: {
          pageNum: 0,
          pageSize: 10,
          total: 0,
        },
        lists: [],
        selectRows: [],
        showModify: false,
      }
    },
    mounted() {
      this.ajaxList();
    },
    methods: {
      async deleteOne(id){
                var result = await axios.get('/${tableNameSmall}/delete?id='+id).then(res => res.data).then(res => res.result)
                this.ajaxList();
            },
      triggerModify() {
        this.$refs['modifyDialog'].init()
      },
      async ajaxList() {
        var _params = {}
        console.log("[get]  /${tableNameSmall}/page")
        console.log('参数', JSON.stringify(_params))
        var result = await axios.get('/${tableNameSmall}/page?pageNum='+this.filter.pageNum+'&&pageSize='+this.filter.pageSize+'', _params).then(res => res.result)
        console.log("结果", result)
        this.lists = result.records
        this.filter.total = Number(result.total)
        this.filter.pageSize = Number(result.size)

      }
    }
  }
</script>



`
    return controllerTemplate;
}

function createVueModify(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    var formValidateStr = ``
    var formStr = ``
    lodash.map(cols, (define, key) => {
        var disabled = (key == 'id');
        var str = `
              <el-form-item label="${toHump(define.description || key)}" prop="${toHump(key)}" disabled="${disabled}">
          <el-input v-model="form.${toHump(key)}" :disabled="${disabled}" placeholder="${toHump(define.description || key)}"
          clearable
          ></el-input>
        </el-form-item>
        `
        var str1 = `
           ${toHump(key)}: [{required: true, trigger: 'blur',message:"${toHump(define.description || key)}不能为空"}],
        `
        var str2 = `${toHump(key)}:"",`
        colStr += str;
        formValidateStr += str1;
        formStr += str2;

    })
    const controllerTemplate = `

<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogVisible"
    width="30%"
    :before-close="handleClose">
    <div>
      <el-form
        :rules="loginRules"
        ref="form" :model="form" label-width="80px">
${colStr}
       
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="()=>{
   submit()
    }">确 定</el-button>
  </span>
  </el-dialog>

</template>
<script>
  import axios from '@/utils/request'

  export default {
    data() {
      return {
        title: "管理",
        dialogVisible: false,
        form: {${formStr}},
        loginRules: {
         ${formValidateStr}
        },
      }
    },
    methods: {
      handleClose() {
          this.$data.dialogVisible=false;
          this.$refs['form'] && this.$refs['form'].resetFields();
      },
      init(_data) {
        if (_data && _data.id) {
          this.title = "修改"
        } else {
          this.title = "添加"
        }
        this.dialogVisible = true
        this.form = _data ? _data : {}
      },
      async submit() {
        this.$refs['form'].validate(async (isyes) => {
          if (isyes) {
            var _params = this.form
            console.log("[get]  /${tableNameSmall}/add")
            console.log('参数', JSON.stringify(_params))
            var url=this.form.id?'/${tableNameSmall}/update':'/${tableNameSmall}/add'
            var result = await axios.post(url, _params).then(res => res.data)
            console.log("结果", result)
            this.dialogVisible = false;
            this.$emit('refresh')
          }
        })
      }
    }
  }
</script>




`
    return controllerTemplate;
}

function createJsJson(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    var formValidateStr = ``
    var formStr = ``
    var resultJson = {}
    lodash.map(cols, (define, key) => {
        var disabled = (key == 'id');
        var str = `${toHump(key)}: "",`
        colStr += str;
        resultJson[toHump(key)] = ""

    })
    const controllerTemplate = resultJson
    return controllerTemplate;
}

function createVueList1(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    lodash.map(cols, (define, key) => {
        var str = `
             <el-table-column 
             v-if="!columnsHidden['${toHump(key)}']"
            label="${toHump(define.description || key)}" prop="${toHump(key)}">
          </el-table-column>
        `
        colStr += str

    })
    const controllerTemplate = `

<template>
  <div class="app-container" style="padding: 20px;">
        
        <el-form
          :model="queryParams"
          ref="queryForm"
          :inline="true"
          v-show="showSearch">
          <el-form-item label="名称" prop="name">
            <el-input
              v-model="queryParams.name"
              placeholder="名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @submit.native.prevent
              @click="handleQuery">搜索
            </el-button >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置
            </el-button>
          </el-form-item>
        </el-form>
       
       
       
       
         <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="$refs['modifyDialog'].init()"
            >新增
            </el-button>
          </el-col>
          <right-toolbar
            @layout="(_obj)=>columnsHidden=_obj"
            :showSearch.sync="showSearch"
            @queryTable="getInfoList"
          ></right-toolbar>
        </el-row>
        
        
        
    <el-table
    border
      ref="multipleTable"
      :data="dataList"
      v-loading="loading"
      tooltip-effect="dark"
      style="width: 100%"

      >
      
     ${colStr}
     
      <el-table-column
        label="操作" width="220"
        fixed="right">
        <template slot-scope="scope">
        
        <el-button  size="mini" type="text" icon="el-icon-edit"  @click="()=>$refs['modifyDialog'].init(scope.row)">修改</el-button>
        
         <el-button size="mini"  type="text"  icon="el-icon-notebook-1"  @click="()=>openLog(scope.row)"  >变更日志  </el-button>
            
         <el-button  size="mini" type="text" icon="el-icon-delete"  @click="()=>handleDelete(scope.row)"  >删除</el-button>


      
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
    :background="true"
      style="padding: 20px;"
      :page-size="queryParams.pageSize"
      layout="prev, pager, next"
      :total="total"
      @size-change="(pageSize)=>{$data.queryParams.pageSize=pageSize;dataList=[];getInfoList();}"
      @current-change="(pageNum)=>{$data.queryParams.pageNum=pageNum;dataList=[];getInfoList();}"
    >
    </el-pagination>

    <!--弹出框-->
    <modify class="vue" ref="modifyDialog" @refresh="()=>getInfoList()"></modify>
  </div>
</template>
<script>
  import {formData, formMethod, PageData} from "@/utils/formcommon";
  const api = require('@/api/manage/${tableNameSmall}.js')

  export default {
    components: {
      modify: () => import('./modify')
    },
    data() {
      return {
         api: api,
           ...formData,
        queryParams: {
            name:"",
          ...PageData
        },
        lists: [],
        selectRows: [],
      }
    },
    mounted() {
      this.getInfoList();
    },
    methods: {
      ...formMethod,
      triggerModify() {
        this.$refs['modifyDialog'].init()
      },
    }
  }
</script>
`
    return controllerTemplate;
}

function createVueModify1(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var colStr = ``;
    var formValidateStr = ``
    var formStr = ``
    lodash.map(cols, (define, key) => {
        var disabled = (key == 'id');
        var str = `
              <el-form-item label="${toHump(define.description || key)}" prop="${toHump(key)}" disabled="${disabled}">
          <el-input v-model="form.${toHump(key)}" :disabled="${disabled}" placeholder="${toHump(define.description || key)}"
          clearable
          ></el-input>
        </el-form-item>
        `
        var str1 = `
           ${toHump(key)}: [{required: false, trigger: 'blur',message:"${toHump(define.description || key)}不能为空"}],
        `
        var str2 = `${toHump(key)}:"",`
        colStr += str;
        formValidateStr += str1;
        formStr += str2;

    })
    const controllerTemplate = `

<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogVisible"
    width="500px"
    :before-close="handleClose"
    append-to-body
    >
    <div>
      <el-form
        :rules="Rules"
        ref="form" :model="form" label-width="120px">
${colStr}
       
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary"
    :loading="loadingStatus.modify"
    @click="submitFormInModify"
    >确 定</el-button>
  </span>
  </el-dialog>

</template>
<script>
  const api = require('@/api/manage/${tableNameSmall}.js')
  import {setPriceForShow,setPriceForForm,deepClone} from "@/utils";
  import {formData, formMethod} from "@/utils/formcommon";


 const INIT_FORM_DATA ={${formStr}}
  export default {
    data() {
      return {
        ...formData,
        api: api,
        title: "管理",
        dialogVisible: false,
        form: INIT_FORM_DATA,
        Rules: {
         ${formValidateStr}
        },
      }
    },
    methods: {
      ...formMethod,
      init(_data) {
        this.__init(_data);
        var __data= _data ? deepClone(_data) : deepClone(INIT_FORM_DATA)
        this.form = this.dataForShow(__data)
      },
    }
  }
</script>




`
    return controllerTemplate;
}


function createJson2(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    return {
        tableName, cols
    };
}

function createApi(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))

    var str = `
import request from '@/utils/request'

// 查询${tableNameSmall}列表
export function getList(data) {
  return request({
    url: '/${tableNameSmall}/getlist',
    method: 'post',
    data: data
  })
}

// 查询${tableNameSmall}详细
export function getItem(id) {
  return request({
    url: '/${tableNameSmall}/getbyid',
    method: 'get',
    params: {id:id}
  })
}

// 新增${tableNameSmall}
export function add(data) {
  return request({
    url: '/${tableNameSmall}/add',
    method: 'post',
    data: data
  })
}

// 修改${tableNameSmall}
export function update(data) {
  return request({
    url: '/${tableNameSmall}/update',
    method: 'post',
    data: data
  })
}

// 删除${tableNameSmall}
export function del(id) {
  return request({
    url: '/${tableNameSmall}/delbyid' ,
    method: 'get',
    params: {id:id}
  })
}

// 查询${tableNameSmall}日志
export function getLogs(data) {
  return request({
    url: '/${tableNameSmall}/getlogs' ,
    method: 'post',
    data: data
  })
}



`
    return str;
}

function create水平table(tableName, cols) {
    var tableNameBig = firstworldupp(toHump(tableName))
    var tableNameSmall = firstworlddown(toHump(tableName))
    var str = ``
    lodash.map(cols, (define, key) => {
        str += `${key}--${define.description }   ||   `
    })
    return str;
}


function createTemplate(ddlStr) {
    const parser = new Parser('mysql');
    /* CREATE TABLE `match_activity_pair` (
         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
         `peroid` int(10) DEFAULT NULL COMMENT '周期（洽谈时间）',
         `order` int(10) DEFAULT NULL COMMENT '顺序',
         `startTime` datetime DEFAULT NULL COMMENT '开始洽谈时间',
         `endTime` datetime DEFAULT NULL COMMENT '结束洽谈时间',
         `demandId` bigint(20) DEFAULT NULL COMMENT '需求id',
         `meetingId` bigint(20) DEFAULT NULL COMMENT '会议id',
         `supplierId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '供应商id',
         `purchaserId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '采购商id',
         `activityId` bigint(20) DEFAULT NULL COMMENT '商贸活动id',
         `sponsor` int(1) DEFAULT NULL COMMENT '0:供应商发起(pc) 1:采购商发起(主办后台)',
         `status` int(1) DEFAULT '0' COMMENT '预约状态 0:待确认 1:已确认 2:被拒绝 3:已取消',
         `projectId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动id',
         `isStart` int(1) DEFAULT '2' COMMENT '会议状态标识 1：开始 0：结束 2 未开始',
         PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=442 DEFAULT CHARSET=utf8;*/

    if (ddlStr.indexOf(";") <= 0) {
        ddlStr + ";"
    }
    const jsonSchemaDocuments = parser.feed(ddlStr)
        .toJsonSchemaArray({});
    var json = jsonSchemaDocuments[0]
    var tableName = json.title
    var definitions = json.definitions
    var keys = []
    const entityResult = createEntity(tableName, definitions)
    const mapperResult = createMapper(tableName, definitions)
    // console.log("entityResult",entityResult)
    return {
        tableName,
        entity: entityResult,
        mapper: mapperResult,
        service: createService(tableName, definitions),
        serviceImpl: createServiceImpl(tableName, definitions),
        controller: createController(tableName, definitions),
        vuelist: createVueList(tableName, definitions),
        vuemodify: createVueModify(tableName, definitions),
        jsjson: (createJsJson(tableName, definitions)),
        vuelist1: createVueList1(tableName, definitions),
        vuemodify1: createVueModify1(tableName, definitions),
        api: createApi(tableName, definitions),
        json2: createJson2(tableName, definitions),
        水平table: create水平table(tableName, definitions),

    }

}

module.exports = createTemplate